const net = require('net');

const server = net.createServer((socket) => {
    socket.on('data', (data) => {
        socket.write('你好\n');
    });

    socket.on('end', () => {
        console.log('连接断开');
    });

    socket.write('欢迎光临《深入浅出 Node.js》示例：\n');
});

server.listen('/tmp/echo.sock', () => {
    console.log('server bound');
});
